var masker = {
    el: $("#J_mask"),
    init: function () {
        $(".pop-close").off("click").click(function (e) {
            e.stopPropagation();
            $(this).parent().hide();
            masker.el.hide();
        });
        return this;
    },
    show: function (layer, callback) {
        masker.el.show();
        $("#" + layer).show();
        if (typeof (callback) === "function") {
            callback();
        }
    }
};

var tips = {
    _errTips: [],
    init: function () {
        return "";
    },
    show: function () {
        alert(this.getError());
        return this;
    },
    longshow: function () {
        alert(this.getError());
        return this;
    },
    close: function () {
        tips.clearError();
        return this;
    },
    clearError: function () {
        tips._errTips = [];
        return this;
    },
    setError: function (err) {
        tips._errTips.push(err);
        return this;
    },
    getError: function () {
        var el = tips._errTips;
        var errors = "";
        for (var i = 0, l = el.length; i < l; i++) {
            errors += el[i]+"\n";
        }
        return errors;
    }
};